<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.SQLException" %><%--
  Created by IntelliJ IDEA.
  User: 张勤晓
  Date: 2023/10/27
  Time: 20:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    Class.forName("com.mysql.jdbc.Driver");

    String url = "jdbc:mysql:///db1?useSSL=false";
    String username = "root";
    String password = "1234";

    Connection conn = DriverManager.getConnection(url, username, password);

    String sql = "DELETE FROM tb_brand where id = " + request.getParameter("id");

    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.executeUpdate();
    pstmt.close();
    conn.close();
%>
